package com.github.minglie.mingbase.config;

import com.github.minglie.mingbase.utils.DbUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.core.JdbcTemplate;
import org.sqlite.SQLiteDataSource;


@Configuration
public class JdbcTemplateConfig {

    @Value("${sqlite.datasource.url}")
    private String sqliteDatasourceUrl;

    @Bean
    public JdbcTemplate jdbcTemplate(){
        SQLiteDataSource source = new SQLiteDataSource();
        source.setUrl(sqliteDatasourceUrl);
        return new  JdbcTemplate(source);
    }

}
